Part of a series of articles on |
the mathematical constant Ï |
---|
Uses |
Properties |
Value |
|
People |
History |
In culture |
Related topics |
This page is about the history of approximations for the mathematical constant pi (Ï). There is a table summarizing the chronology of computation of Ï. See also the history of pi for other aspects of the evolution of our knowledge about mathematical properties of pi. Its first 50 decimal places are:
3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510.
Some Egyptologists[1] have concluded that the ancient Egyptians used an approximation of pi in their monuments, as the Great Pyramid of Giza was built so that the circle whose radius is equal to the height of the pyramid has a circumference equal to the perimeter of the base (it is 1760 cubits around and 280 cubits in height)[2] Others have argued that the ancient Egyptians had no concept of pi and would not have thought to encode it in their monuments. They argue, based on documents such as the Rhind papyrus, that the shapes of the pyramids are based on simple ratios of the sides of right angled triangles (the seked).,[3] however, the Rhind Papyrus in fact shows that the Seked was derived from the base and height dimensions, and not the converse.[4]
An Egyptian scribe named Ahmes wrote the oldest known text to imply an approximate value for pi. The Rhind Mathematical Papyrus dates from the Egyptian Second Intermediate Period â though Ahmes stated that he copied a Middle Kingdom papyrus (i.e. from before 1650 BCE). In problem 48 the area of a circle was computed by approximating the circle by an octagon. The value of pi is never mentioned or computed, however. If the Egyptians knew of pi, then the corresponding approximation was 256/81.[3][5]
As early as the 19th century BCE, Babylonian mathematicians were using Ï â 25/8, which is about 0.5 percent below the exact value.
The Indian astronomer Yajnavalkya gave astronomical calculations in the Shatapatha Brahmana (c. 9th century BCE) that led to a fractional approximation of Ï â 339/108 (which equals 3.13888..., which is correct to two decimal places when rounded, or 0.09 percent below the exact value).
In the third century BCE, Archimedes proved the sharp inequalities 223â71 < Ï < 22â7, by means of regular 96-gons; these values are 0.02 percent and 0.04 percent off, respectively. Later, in the second century CE, Ptolemy, using a regular 360-gon, obtained a value of 3.141666...., which is correct to three decimal places.[6]
The Chinese mathematician Liu Hui in 263 CE computed pi to between 3.141024 and 3.142708 by inscribing an 96-gon and 192-gon; the average of these two values is 3.141864, an error of less than 0.01 percent. However, he suggested that 3.14 was a good enough approximation for practical purposes. Later he obtained a more accurate result Ï â 3927/1250 = 3.1416.
Until the year 1000 CE, pi was known to fewer than 10 decimal digits only.
In 499 CE India, mathematician Aryabhata calculated the value of pi to five significant figures (Ï â 3.1416) in his astronomical treastise Äryabhaá¹Ä«ya,[7] and used the figures to work out a very close approximation of the earth's circumference.[8] Contemporary mathematicians noted that Aryabhata might have even concluded that pi was an irrational number.[9]
Aryabhata wrote in the second part of the Aryabhatiyam (gaá¹itapÄda 10):
chaturadhikam ÅatamaÅá¹aguá¹am dvÄÅaÅá¹istathÄ sahasrÄá¹Äm
AyutadvayaviÅkambhasyÄsanno vrîttapariá¹ahaḥ.
meaning:
Add four to one hundred, multiply by eight and then add sixty-two thousand. The result is approximately the circumference of a circle of diameter twenty thousand. By this rule the relation of the circumference to diameter is given.
In other words, (4 + 100) Ã 8 + 62000 is the circumference of a circle with diameter 20000. This provides a value of Ï â 62832/20000 = 3.1416, correct to four decimal places. The commentator Nilakantha Somayaji (Kerala school of astronomy and mathematics, 15th century) has argued that the word Äsanna (approaching), appearing just before the last word, here means not only that this is an approximation, but that the value is incommensurable (or irrational). However, the existence or usefulness of a rational approximation to a quantity does not mean the quantity is irrational. Also, the claim is only a conjecture, not a proof. The irrationality of pi was proved in Europe in 1761 by Lambert.
The 5th century Chinese mathematician and astronomer Zu Chongzhi computed pi between 3.1415926 and 3.1415927, which was correct to seven decimal places. He gave two other approximations of pi: Ï â 22/7 and Ï â 355/113.
In the 14th century, the Indian mathematician and astronomer Madhava of Sangamagrama, founder of the Kerala school of astronomy and mathematics, discovered the infinite series for pi, now known as the MadhavaâLeibniz series,[10][11] and gave two methods for computing the value of pi. One of these methods is to obtain a rapidly converging series by transforming the original infinite series of pi. By doing so, he obtained the infinite series
and used the first 21 terms to compute an approximation of pi correct to 11 decimal places as 3.14159265359.
The other method he used was to add a remainder term to the original series of pi. He used the remainder term
in the infinite series expansion of Ïâ4 to improve the approximation of pi to 13 decimal places of accuracy when n = 75.
The Persian mathematician and astronomer, Ghyath ad-din Jamshid Kashani (1380â1429), correctly computed 2Ï to 9 sexagesimal digits.[12] This figure is equivalent to 16 decimal digits as
which equates to
He achieved this level of accuracy by calculating the perimeter of a regular polygon with 3 Ã 2Ã1018 sides.
The German mathematician Ludolph van Ceulen (circa 1600) computed the first 35 decimal places of pi. He was so proud of this accomplishment that he had them inscribed on his tombstone.
The Slovene mathematician Jurij Vega in 1789 calculated the first 140 decimal places for pi of which the first 126 were correct [2] and held the world record for 52 years until 1841, when William Rutherford calculated 208 decimal places of which the first 152 were correct. Vega improved John Machin's formula from 1706 and his method is still mentioned today.
The English amateur mathematician William Shanks, a man of independent means, spent over 20 years calculating pi to 707 decimal places. This was accomplished in 1873, although only the first 527 were correct. His routine was as follows: He would calculate new digits all morning; and then he would spend all afternoon checking his morning's work. This was the longest expansion of pi until the advent of the electronic digital computer three-quarters of a century later.
The GaussâLegendre algorithm is used for calculating digits of pi.
In 1910, the Indian mathematician Srinivasa Ramanujan found several rapidly converging infinite series of pi, including
which computes a further eight decimal places of pi with each term in the series. His series are now the basis for the fastest algorithms currently used to calculate pi.
From the mid-20th century onwards, all calculations of pi have been done with the help of calculators or computers.
In 1944, D. F. Ferguson, with the aid of a mechanical desk calculator, found that William Shanks had made a mistake in the 528th decimal place, and that all succeeding digits were incorrect.
In the early years of the computer, an expansion of pi to 100,265 decimal places[13]:78 was computed by Maryland mathematician Dr. Daniel Shanks and his team at the United States Naval Research Laboratory (N.R.L.) in Washington, D.C. (Dr. Shanks's son Oliver Shanks, also a mathematician, states that there is no connection to William Shanks, and that his family's roots are in Central Europe.
In 1961, Daniel Shanks and his team used two different power series for calculating the digits of pi. For one it was known that any error would produce a value slightly high, and for the other, it was known that any error would produce a value slightly low. And hence, as long as the two series produced the same digits, there was a very high confidence that they were correct. The first 100,000 digits of pi were published by the N.R.L.[13] :80â99 The authors outlined what would be needed to calculate pi to 1 million decimal places and concluded that the task was beyond that day's technology, but would be possible in five to seven years.[13]:78
In 1989, the Chudnovsky brothers correctly computed pi to over a 1 billion decimal places on the supercomputer IBM 3090 using the following variation of Ramanujan's infinite series of pi:
In 1999, Yasumasa Kanada and his team at the University of Tokyo correctly computed pi to over 200 billion decimal places on the supercomputer HITACHI SR8000/MPP (128 nodes) using another variation of Ramanujan's infinite series of pi. In October 2005 they claimed to have calculated it to 1.24 trillion places.[14]
In August 2009, a Japanese Supercomputer called the T2K Open Supercomputer was claimed to have more than doubled the previous record by calculating pi to 2.6 trillion digits in approximately 73 hours and 36 minutes.
In December 2009, Fabrice Bellard used a home computer to compute 2.7 trillion decimal digits of pi. Calculations were performed in base 2 (binary), then the result was converted to base 10 (decimal). The calculation, conversion, and verification steps took a total of 131 days.[15]
In August 2010, Shigeru Kondo used Alexander Yee's y-cruncher to calculate 5 trillion digits of pi. This was the world record for any type of calculation, but significantly it was performed on a home computer built by Kondo.[16] The calculation was done between May 4 and August 3, with the primary and secondary verifications taking 64 and 66 hours respectively.[17] In October 2011, they then broke their own record by correctly computing ten trillion (1013) digits using the same method but with better hardware.[18][19]
Some approximations which have been given for pi are notable in that they were less precise than previously known values.
It is sometimes claimed that the Bible implies that pi is about three, based on a passage in 1 Kings 7:23 and 2 Chronicles 4:2 giving measurements for the round basin located in front of the Temple in Jerusalem as having a diameter of 10 cubits and a circumference of 30 cubits. Rabbi Nehemiah explained this in his Mishnat ha-Middot (the earliest known Hebrew text on geometry, ca. 150 CE) by saying that the diameter was measured from the outside rim while the circumference was measured along the inner rim. This interpretation implies a brim 0.22535 cubit (or, assuming an 18-inch âcubitâ, some 4 inches) thick, or roughly one âhandbreadthâ (cf. 1 Kings 7:24 and 2 Chronicles 4:3).
The interpretation of the biblical passage is still disputed,[20][21] however, and other explanations have been offered, including that the measurements are given in round numbers (as the Hebrews tended to round off measurements to whole numbers), or that cubits were not exact units, or that the basin may not have been exactly circular, or that the brim was wider than the bowl itself. Many reconstructions of the basin show a wider brim (or flared lip) extending outward from the bowl itself by several inches to match the description given in 1 Kings 7:26[22] In the succeeding verses, the rim is described as "a handbreadth thick; and the brim thereof was wrought like the brim of a cup, like the flower of a lily: it received and held three thousand baths" 2 Chronicles 4:5, which suggests a shape that can be encompassed with a string shorter than the total length length of the brim, e.g., a Lilium flower or a Teacup.
The issue is discussed in the Talmud and in Rabbinic literature.[23] Among the many explanations and comments are these:
Another explanation is that the 10-cubit measurement was from "brim to brim" or "lip to lip." That is, the ritual bath had a brim or lip which protruded beyond the main body of the vessel. The 10 cubits is described as the measurement from brim to brim, and a 30 cubit cord could completely encircle the main body of the vessel below the lip.
The "Indiana Pi Bill" of 1897, which never passed out of the committee of the Indiana General Assembly in the U.S., has been claimed to imply a number of different values for pi, although the closest it comes to explicitly asserting one is the wording "the ratio of the diameter and circumference is as five-fourths to four", which would make Ï = 16/5 = 3.2, a discrepancy of nearly 2 percent.
For fast calculations, one may use formulae such as Machin's:
together with the Taylor series expansion of the function arctan(x). This formula is most easily verified using polar coordinates of complex numbers, producing:
Another example is:
which is verified as above as producing a 45° vector:
Formulae of this kind are known as Machin-like formulae.
Other formulae that have been used to compute estimates of pi include:
David Chudnovsky and Gregory Chudnovsky:
Extremely long decimal expansions of pi are typically computed with iterative formulae like the GaussâLegendre algorithm and Borwein's algorithm. The latter, found in 1985 by Jonathan and Peter Borwein, converges extremely fast:
For and
where , the sequence converges quartically to pi, giving about 100 digits in three steps and over a trillion digits after 20 steps.
The first one million digits of pi and 1âÏ are available from Project Gutenberg (see external links below). A former calculation record (December 2002) by Yasumasa Kanada of Tokyo University stood at 1.2 billion digits, which were computed in September 2002 on a 64-node Hitachi supercomputer with 1 terabyte of main memory, which carries out 2 trillion operations per second, nearly twice as many as the computer used for the previous record (206 billion digits). The following Machin-like formulæ were used for this:
These approximations have so many digits that they are no longer of any practical use, except for testing new supercomputers. (Normality of pi will always depend on the infinite string of digits on the end, not on any finite computation.)
In 1997, David H. Bailey, Peter Borwein and Simon Plouffe published a paper (Bailey, 1997) on a new formula for pi as an infinite series:
This formula permits one to easily compute the kth binary or hexadecimal digit of pi, without having to compute the preceding k â 1 digits. Bailey's website contains the derivation as well as implementations in various programming languages. The PiHex project computed 64-bits around the quadrillionth bit of pi (which turns out to be 0).
A feature of the Mandelbrot set recently reported[25] gives a means to calculate an approximate value of pi to any chosen accuracy, without seeking the limit of an infinite series. One assigns
where e is the precision required (e.g. gives pi to k decimal places), and applies the iteration (note that n is just the number of iterations):
The result is simply the approximation
In the graphical view one starts iterating from a point just above the bottom of the "seahorse valley" of the Mandelbrot set at (â0.75, 0).
Historically, for a long time the base 60 was used for calculations. In this base, pi can be approximated to eight (decimal) significant figures as
(The next sexagesimal digit is 0, causing truncation here to yield a relatively good approximation.)
In addition, the following expressions can be used to estimate pi:
Pi can be obtained from a circle if its radius and area are known. Since the area of a circle is given by this formula:
If a circle with radius r is drawn with its center at the point (0, 0), any point whose distance from the origin is less than r will fall inside the circle. The Pythagorean theorem gives the distance from any point (x, y) to the center:
Mathematical "graph paper" is formed by imagining a 1Ã1 square centered around each cell (x, y), wherex and y are integers between âr and r. Squares whose center resides inside or exactly on the border of the circle can then be counted by testing whether, for each cell (x, y),
The total number of cells satisfying that condition thus approximates the area of the circle, which then can be used to calculate an approximation of pi. Closer approximations can be produced by using larger values of r.
Mathematically, this formula can be written:
In other words, begin by choosing a value for r. Consider all cells (x, y) in which bothx and y are integers between âr and r. Starting at 0, add 1 for each cell whose distance to the origin (0,0) is less than or equal to r. When finished, divide the sum, representing the area of a circle of radius r, by r2 to find the approximation of pi. For example, if r is 5, then the cells considered are:
(â5,5) | (â4,5) | (â3,5) | (â2,5) | (â1,5) | (0,5) | (1,5) | (2,5) | (3,5) | (4,5) | (5,5) |
(â5,4) | (â4,4) | (â3,4) | (â2,4) | (â1,4) | (0,4) | (1,4) | (2,4) | (3,4) | (4,4) | (5,4) |
(â5,3) | (â4,3) | (â3,3) | (â2,3) | (â1,3) | (0,3) | (1,3) | (2,3) | (3,3) | (4,3) | (5,3) |
(â5,2) | (â4,2) | (â3,2) | (â2,2) | (â1,2) | (0,2) | (1,2) | (2,2) | (3,2) | (4,2) | (5,2) |
(â5,1) | (â4,1) | (â3,1) | (â2,1) | (â1,1) | (0,1) | (1,1) | (2,1) | (3,1) | (4,1) | (5,1) |
(â5,0) | (â4,0) | (â3,0) | (â2,0) | (â1,0) | (0,0) | (1,0) | (2,0) | (3,0) | (4,0) | (5,0) |
(â5,â1) | (â4,â1) | (â3,â1) | (â2,â1) | (â1,â1) | (0,â1) | (1,â1) | (2,â1) | (3,â1) | (4,â1) | (5,â1) |
(â5,â2) | (â4,â2) | (â3,â2) | (â2,â2) | (â1,â2) | (0,â2) | (1,â2) | (2,â2) | (3,â2) | (4,â2) | (5,â2) |
(â5,â3) | (â4,â3) | (â3,â3) | (â2,â3) | (â1,â3) | (0,â3) | (1,â3) | (2,â3) | (3,â3) | (4,â3) | (5,â3) |
(â5,â4) | (â4,â4) | (â3,â4) | (â2,â4) | (â1,â4) | (0,â4) | (1,â4) | (2,â4) | (3,â4) | (4,â4) | (5,â4) |
(â5,â5) | (â4,â5) | (â3,â5) | (â2,â5) | (â1,â5) | (0,â5) | (1,â5) | (2,â5) | (3,â5) | (4,â5) | (5,â5) |
The 12 cells (0, ±5), (±5, 0), (±3, ±4), (±4, ±3) are exactly on the circle, and 69 cells are completely inside, so the approximate area is 81, and pi is calculated to be approximately 3.24 because 81 / 52 = 3.24. Results for some values of r are shown in the table below:
r | area | approximation of pi |
---|---|---|
2 | 13 | 3.25 |
3 | 29 | 3.22222 |
4 | 49 | 3.0625 |
5 | 81 | 3.24 |
10 | 317 | 3.17 |
20 | 1257 | 3.1425 |
100 | 31417 | 3.1417 |
1000 | 3141549 | 3.141549 |
Similarly, the more complex approximations of pi given below involve repeated calculations of some sort, yielding closer and closer approximations with increasing numbers of calculations.
Pi is defined as the ratio of the circumference of a circle to its diameter. Circles can be approximated as regular polygons with an increasing number of sides, approaching infinity. Archimedes used this method with a 96-sided polygon to show that pi is between 223/71 and 22/7.
Besides its simple continued fraction representation [3; 7, 15, 1, 292, 1, 1, â¦], which displays no discernible pattern, pi has many generalized continued fraction representations generated by a simple rule, including these two.
(Other representations are available at The Wolfram Functions Site.)
is the power series for arctan(x) specialized to x = 1. It converges too slowly to be of practical interest. However, the power series converges much faster for smaller values of , which leads to formulas where arises as the sum of small angles with rational tangents, such as these two by John Machin:
Formulas for pi of this type are known as Machin-like formulae.
Knowing that the formula can be simplified to get:
with a convergence such that each additional 10 terms yields at least three more digits.
Observing an equilateral triangle and noting that
yields
with a convergence such that each additional five terms yields at least three more digits.
The GaussâLegendre algorithm or SalaminâBrent algorithm was discovered independently by Richard Brent and Eugene Salamin in 1975. This can compute to digits in time proportional to , much faster than the trigonometric formulae.
The BaileyâBorweinâPlouffe formula (BBP) for calculating pi was discovered in 1995 by Simon Plouffe. The formula computes pi in base 16 without needing to compute the previous digits (digit extraction). [30]
In 1996, Simon Plouffe derived an algorithm to extract the nth digit of pi in an arbitrary base in O(n3log(n)3) time.[31] In 1997, this was improved to O(n2) by Fabrice Bellard, who derived an alternative formula for computing pi in base 2.[32]
In 1961 the first expansion of pi to 100,000 decimal places was computed by Maryland mathematician Dr. Daniel Shanks and his team at the United States Naval Research Laboratory (N.R.L.).
Daniel Shanks and his team used two different power series for calculating the digits of pi. For one it was known that any error would produce a value slightly high, and for the other, it was known that any error would produce a value slightly low. And hence, as long as the two series produced the same digits, there was a very high confidence that they were correct. The first 100,000 digits of pi were published by the Naval Research Laboratory.
None of the formulæ given above can serve as an efficient way of approximating pi. For fast calculations, one may use a formula such as Machin's:
together with the Taylor series expansion of the function arctan(x). This formula is most easily verified using polar coordinates of complex numbers, starting with,
Formulae of this kind are known as Machin-like formulae. (Note also that {x,y} = {239, 132} is a solution to the Pell equation x2-2y2 = -1.)
Many other expressions for pi were developed and published by Indian mathematician Srinivasa Ramanujan. He worked with mathematician Godfrey Harold Hardy in England for a number of years.
Extremely long decimal expansions of pi are typically computed with the GaussâLegendre algorithm and Borwein's algorithm; the SalaminâBrent algorithm which was invented in 1976 has also been used.
The first one million digits of pi and 1/Ï are available from Project Gutenberg (see external links below). The record as of December 2002 by Yasumasa Kanada of Tokyo University stood at 1,241,100,000,000 digits, which were computed in September 2002 on a 64-node Hitachi supercomputer with 1 terabyte of main memory, which carries out 2 trillion operations per second, nearly twice as many as the computer used for the previous record (206 billion digits). The following Machin-like formulæ were used for this:
These approximations have so many digits that they are no longer of any practical use, except for testing new supercomputers. (Normality of pi will always depend on the infinite string of digits on the end, not on any finite computation.)
In 1997, David H. Bailey, Peter Borwein and Simon Plouffe published a paper (Bailey, 1997) on a new formula for pi as an infinite series:
This formula permits one to fairly readily compute the kth binary or hexadecimal digit of pi, without having to compute the preceding k â 1 digits. Bailey's website contains the derivation as well as implementations in various programming languages. The PiHex project computed 64-bits around the quadrillionth bit of pi (which turns out to be 0).
Fabrice Bellard claims to have beaten the efficiency record set by Bailey, Borwein, and Plouffe with his formula to calculate binary digits of pi [3]:
Other formulae that have been used to compute estimates of pi include:
This converges extraordinarily rapidly. Ramanujan's work is the basis for the fastest algorithms used, as of the turn of the millennium, to calculate pi.
Pi Hex was a project to compute three specific binary digits of pi using a distributed network of several hundred computers. In 2000, after two years, the project finished computing the five trillionth (1012), the forty trillionth, and the quadrillionth (1015) bits. All three of them turned out to be 0.
Over the years, several programs have been written for calculating pi to many digits on personal computers.
Most computer algebra systems can calculate pi and other common mathematical constants to any desired precision.
Functions for calculating pi are also included in many general libraries for arbitrary-precision arithmetic, for instance CLN and MPFR.
An example of a web-based computer script (written in PHP) has been made to calculate pi and is below. It is designed to be able to follow Viète's formula for calculating pi and if this script is given enough time to run, it can display 1000 digits of pi.
<?php set_time_limit(0); echo '<br />'; $digits=1000; $pival='1'; $str1=''; while ($pirow<2000) { $pirow+=1; $pisubrow=0; $tempval='0'; while ($pisubrow<$pirow) { $tempval=bcsqrt(bcadd('2',$tempval,$digits),$digits); $pisubrow+=1; sleep(1); } $tempval=bcdiv('2',$tempval,$digits); $pival=bcmul($tempval,$pival,$digits); unset($tempval); $tempval=bcmul('2',$pival,$digits); $common = array(); $length = (strlen($str1) >= strlen($tempval)) ? strlen($str1) : strlen($tempval); for($x=0;$x<$length;$x++){ if($str1[$x] == $tempval[$x]){ $common[] = $str1[$x]; }else{ break; } } if ($pirow>5) { echo 'pi='.substr(join('',$common),0,-2); } unset($str1); $str1=$tempval; unset($tempval); echo '<p>'; flush(); sleep(1); } $pival=bcmul($pival,'2',$digits); unset($pirow); ?>
The above PHP script will need to be given at least two minutes for a useful result to be displayed. The script can continue to run for days with no errors. If there is no worry about CPU usage in this script then the lines with the sleep()
function can be removed for a faster result.
Programs designed for calculating pi may have better performance than general-purpose mathematical software. They typically implement checkpointing and efficient disk swapping to facilitate extremely long-running and memory-expensive computations.